package com.ziyear.provider.dubbo.impl;

import com.ziyear.spi.dto.ReqDTO;
import com.ziyear.spi.dto.ResDTO;
import com.ziyear.spi.service.DubboTestService;
import lombok.extern.slf4j.Slf4j;

import java.util.Random;

@Slf4j
public class DubboTestServiceImpl implements DubboTestService {
    @Override
    public String sayHello(String username) {
        return "Hello: " + username;
    }

    @Override
    public void doWork(String username) {
        log.info("doWork req info {}.", username);
    }

    @Override
    public ResDTO queryUser(ReqDTO req) {
        ResDTO resDTO = new ResDTO();
        resDTO.setId(req.getId());
        resDTO.setName("测试用户");
        resDTO.setAge(new Random().nextInt(35) + 10);
        return resDTO;
    }
}
